toTable format?

I'm trying to create a DXL script to take imported data and turn it into a DOORS table. I've looked over the DOORS reference manual, and found the function toTable() which looks like exactly what I need. The documentation is a little scare on details, so I've been fiddling around, trying to figure out how is works. I thought I had it, but when I created a test document and tried out my script, I get this error:

<Line:23> A hierarchy to be converted into a table can only be 3 levels deep (table, rows, cells).

This is what my test module looks like, it's very basic, and I don't understand what's wrong:

Table
-Row 1
--Row 1, Cell 1
--Row 1, Cell 2
--Row 1, Cell 3
-Row 2
--Row 2, Cell 1
--Row 2, Cell 2
--Row 2, Cell 3

Here is my script for reference:
 

Module mModule = current Module
Object mObject = null
string mTableObject = ""
 
if ( !isEdit( mModule ) )
{
    infoBox( "This utility can only be run in exclusive edit mode" )
        halt
}
 
for mObject in mModule do
{
        mTableObject = mObject."Table"
        
        if ( !table( mObject ) )
        {
                if ( mTableObject == "Y" )
                {
                        toTable( mObject )      
                        mObject = next sibling mObject          
                }     
        }
}

 


I'm very inexperienced with DXL, so it's probably something obvious, but I sure don't know what the problem is.

 


Matthew Dunn - Mon Nov 16 12:28:23 EST 2009

Re: toTable format?
doors36677 - Mon Nov 16 13:07:02 EST 2009

Attached is a before an after of a conversion I just did.
Attachments

attachment_14360804_beforeAfter.bmp

Re: toTable format?
Matthew Dunn - Mon Nov 16 13:20:47 EST 2009

doors36677 - Mon Nov 16 13:07:02 EST 2009
Attached is a before an after of a conversion I just did.

Well, that looks exactly like what I'm trying to do. Your "before" picture looks pretty much just like mine.

Was that using my code or something you had? Care to elaborate on how you got it to work? Every time I run the code above, I get that same error message. Is there some way I can step through the script and try to debug the code?

Re: toTable format?
doors36677 - Mon Nov 16 13:35:47 EST 2009

Matthew Dunn - Mon Nov 16 13:20:47 EST 2009
Well, that looks exactly like what I'm trying to do. Your "before" picture looks pretty much just like mine.

Was that using my code or something you had? Care to elaborate on how you got it to work? Every time I run the code above, I get that same error message. Is there some way I can step through the script and try to debug the code?

With Heading 1 selected, My code was

Object o=current
toTable(o)